package admrouter

import (
	"github.com/gin-gonic/gin"
	"yundian/internel/app/handlers/pcl/admin/automate"
	"yundian/internel/app/handlers/pcl/admin/stewarduploadhandler"
	"yundian/internel/app/middlewares"
	"yundian/internel/pkg/dingo"
)

func InitAutomate() dingo.ApiRouter {
	return func(g *gin.RouterGroup) {
		{
			a := g.Group("automate")
			a.Use(middlewares.JwtAuthMiddleware)
			a.POST("upload-common-img", stewarduploadhandler.HandleStewardUploadGoodsImg)

			a.POST("get-inventory-log-list", automate.HandleGetInventoryLogList) // 查询售货机库存日志

			a.POST("get-place-goods-list", automate.HandleGetPlaceGoodsList)                                   // 查询售货机门店商品配置列表
			a.POST("insert-place-goods", automate.HandleInsertPlaceGoods)                                      // 新增售货机门店指定商品
			a.POST("update-place-goods", automate.HandleUpdatePlaceGoods)                                      // 修改售货机门店指定商品
			a.POST("set-inventory-place-goods-num", automate.HandleSetInventoryPlaceGoodsNum)                  // 售货机门店商品库存补货
			a.POST("delete-place-goods", automate.HandleDeletePlaceGoods)                                      // 删除门店商品
			a.POST("get-place-goods-inventory-warning-list", automate.HandleGetPlaceGoodsInventoryWarningList) // 门店商品预警列表
			// a.POST("subtract-inventory-goods", automate.HandleInitGoods)              // 售货机门店商品库存退回
			// a.POST("update-goods", automate.HandleInitGoods)                          // 修改售货机门店指定商品

			a.POST("get-goods-list", automate.HandleGetAutomateGoodsList) // 查询售货机商品配置列表
			a.POST("init-goods", automate.HandleInitGoods)                // 初始化售货机化商品
			a.POST("insert-goods", automate.HandleInitGoods)              // 新增售货机指定商品
			a.POST("update-goods", automate.HandleUpdateGoods)            // 修改售货机指定商品
			a.POST("delete-goods", automate.HandleDeleteGoods)            // 删除售货机指定商品

			a.POST("get-goods-bind-list", automate.HandleGetAutomateGoodsBindList) // 查询售货机商品绑定列表
			a.POST("insert-goods-bind", automate.HandleInsertGoodsBind)            // 新增售货机指定商品绑定
			a.POST("update-goods-bind", automate.HandleUpdateGoodsBind)            // 修改售货机指定商品绑定
			a.POST("delete-goods-bind", automate.HandleDeleteGoodsBind)            // 删除售货机指定商品绑定

			a.POST("get-orders-list", automate.HandleGetAutomateOrderList)          // 查询售货机订单列表
			a.POST("get-orders-dividends", automate.HandleGetAutomateDividendsList) // 查询售货机订单分红
			a.POST("cancel-orders", automate.HandleCancelAutomateOrders)            // 撤销售货机订单
		}
	}
}
